package framework.util;

import java.io.Serializable;


public class UndirectedEdge extends DirectedEdge implements Serializable {

	private final Node sourceNode;
	
	public UndirectedEdge(Node srcNode, DirectedEdge edge) {
		super(edge.getPath(), edge.getTargetNode());
		this.sourceNode = srcNode;
	}

	@Override
	public boolean equals(Object arg0) {
		if (arg0 instanceof UndirectedEdge) {
			UndirectedEdge edge = (UndirectedEdge) arg0;
			return ( super.equals(arg0) && this.sourceNode.equals(edge.sourceNode) );
		}
		return false;
	}

	@Override
	public int hashCode() {
		return ( 31 * super.hashCode() + this.sourceNode.hashCode() );
	}

	
}
